#include <iostream>

using namespace std;

/* 无参构造想调用有参构造必须使用初始化列表*/
class Person
{
public:
    Person()
    {
        cout<<"父类无参构造"<<endl;
    }
int m_age;
private:
    
};

class Student : public Person
{
public:
    Student()
    {
        cout<<"子类无参构造"<<endl;
    }
public:
    int m_no;
};

int main()
{
    Student * pstu = new Student();
    pstu->m_age = 30;
    pstu->m_no = 10;

    /* 父类指向子类，不允许子类对象指向父类*/
    Person * pper = new Student();
    pper->m_age = 60;

    return 0;
}